
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>CentOS7下使用YUM安装MySQL5.6 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>CentOS7下使用YUM安装MySQL5.6 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">命令</div>
          <div class="card-question">如何在基于RPM的Linux系统中检查MySQL是否已经安装？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">命令</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">可以执行 `rpm -qa | grep mysql` 命令。如果返回的结果为空值，则说明系统中没有安装MySQL。</div>
          </div>
          <div class="card-source">来源: 1 检查系统中是否已经安装MySQL</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">执行 `rpm -ivh mysql-community-release-el7-5.noarch.rpm` 命令后，会对系统产生什么具体影响？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">安装该软件包后，会在 `/etc/yum.repos.d/` 目录下新增 `mysql-community.repo` 和 `mysql-community-source.repo` 这两个YUM源文件，以便后续通过 `yum` 命令安装MySQL。</div>
          </div>
          <div class="card-source">来源: 3 安装mysql-community-release-el包</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">命令</div>
          <div class="card-question">在准备好MySQL的YUM源之后，应该使用哪个命令来正式安装MySQL服务器？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">命令</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">应该使用 `yum install mysql-server` 命令来安装MySQL服务器。</div>
          </div>
          <div class="card-source">来源: 4 安装mysql</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">命令</div>
          <div class="card-question">请列出使用 `systemctl` 工具来启动、停止MySQL服务以及设置其开机自启的命令。</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">命令</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">启动服务：`systemctl start mysqld.service`；停止服务：`systemctl stop mysqld.service`；设置开机启动：`systemctl enable mysqld.service`。</div>
          </div>
          <div class="card-source">来源: 6 启动 mysql 服务 </div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">根据文档，MySQL 5.6版本在初始安装完成后，其root用户的密码默认状态是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在MySQL 5.6版本安装完成后，root用户的密码默认是空的。</div>
          </div>
          <div class="card-source">来源: 8 设置密码</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">命令</div>
          <div class="card-question">为MySQL的root用户首次设置密码时，需要执行哪几个关键的SQL步骤？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">命令</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">首先，进入MySQL后使用 `use mysql;` 命令；然后，通过 `update user set password=PASSWORD("这里输入root用户密码") where User='root';` 命令更新密码；最后，执行 `flush privileges;` 命令刷新系统权限。</div>
          </div>
          <div class="card-source">来源: 8 设置密码</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">如何配置MySQL以允许root用户从任何远程主机进行登录？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">可以通过执行SQL授权命令 `GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";` 来实现。其中 `%` 代表任意主机。</div>
          </div>
          <div class="card-source">来源: 9 设置远程主机登录</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">如果需要彻底卸载Linux系统上的MySQL，文档中提到了哪三个主要步骤？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">1. 使用 `yum remove mysql mysql-server mysql-libs mysql-server` 移除软件包。 2. 使用 `find / -name mysql` 查找并删除所有相关的残留文件。 3. 再次使用 `rpm -qa|grep mysql` 检查，如果仍有残留，则用 `yum remove` 清理掉。</div>
          </div>
          <div class="card-source">来源: 10 Linux卸载MySQL</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">命令</div>
          <div class="card-question">文档中用于从网络下载MySQL Yum仓库配置文件的命令是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">命令</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">使用 `wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm` 命令进行下载。</div>
          </div>
          <div class="card-source">来源: 2 下载安装文件</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
